package com.ruoyi.configManage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.configManage.mapper.BalanceRechangeConfigMapper;
import com.ruoyi.configManage.domain.BalanceRechangeConfig;
import com.ruoyi.configManage.service.IBalanceRechangeConfigService;

/**
 * 充值配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-12
 */
@Service
public class BalanceRechangeConfigServiceImpl implements IBalanceRechangeConfigService 
{
    @Autowired
    private BalanceRechangeConfigMapper balanceRechangeConfigMapper;

    /**
     * 查询充值配置
     * 
     * @param id 充值配置主键
     * @return 充值配置
     */
    @Override
    public BalanceRechangeConfig selectBalanceRechangeConfigById(Integer id)
    {
        return balanceRechangeConfigMapper.selectBalanceRechangeConfigById(id);
    }

    /**
     * 查询充值配置列表
     * 
     * @param balanceRechangeConfig 充值配置
     * @return 充值配置
     */
    @Override
    public List<BalanceRechangeConfig> selectBalanceRechangeConfigList(BalanceRechangeConfig balanceRechangeConfig)
    {
        return balanceRechangeConfigMapper.selectBalanceRechangeConfigList(balanceRechangeConfig);
    }

    /**
     * 新增充值配置
     * 
     * @param balanceRechangeConfig 充值配置
     * @return 结果
     */
    @Override
    public int insertBalanceRechangeConfig(BalanceRechangeConfig balanceRechangeConfig)
    {
        balanceRechangeConfig.setCreateTime(DateUtils.getNowDate());
        return balanceRechangeConfigMapper.insertBalanceRechangeConfig(balanceRechangeConfig);
    }

    /**
     * 修改充值配置
     * 
     * @param balanceRechangeConfig 充值配置
     * @return 结果
     */
    @Override
    public int updateBalanceRechangeConfig(BalanceRechangeConfig balanceRechangeConfig)
    {
        balanceRechangeConfig.setUpdateTime(DateUtils.getNowDate());
        return balanceRechangeConfigMapper.updateBalanceRechangeConfig(balanceRechangeConfig);
    }

    /**
     * 批量删除充值配置
     * 
     * @param ids 需要删除的充值配置主键
     * @return 结果
     */
    @Override
    public int deleteBalanceRechangeConfigByIds(Integer[] ids)
    {
        return balanceRechangeConfigMapper.deleteBalanceRechangeConfigByIds(ids);
    }

    /**
     * 删除充值配置信息
     * 
     * @param id 充值配置主键
     * @return 结果
     */
    @Override
    public int deleteBalanceRechangeConfigById(Integer id)
    {
        return balanceRechangeConfigMapper.deleteBalanceRechangeConfigById(id);
    }
}
